package com.jiyun.controller;

import com.alibaba.nacos.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiyun.pojo.Guig;
import com.jiyun.pojo.JsonRes;
import com.jiyun.pojo.Specifications;
import com.jiyun.service.GuigService;
import com.jiyun.service.SpecificationsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.sql.Array;
import java.util.ArrayList;
import java.util.List;

/**
 * @author: 刘清芳
 * @description: 控制层
 * @date: 2023/12/21 10:10
 */

//@CrossOrigin(origins = "*")
@RestController
@RequestMapping("specifications")
public class SpecificationsServiceController {
    @Autowired
    SpecificationsService specificationsService;
    @Autowired
    GuigService guigService;
//    查询所有
    @RequestMapping("/findAllspecifications")
    public Page<Specifications>findAllspecifications(@RequestBody Specifications specifications, @RequestParam Integer pageNum,@RequestParam Integer pageSize){
        return specificationsService.findAllspecifications(specifications,pageNum,pageSize);
    }

    //    添加和修改
    @PostMapping("/findadd")
    public String findadd(@RequestBody Specifications specifications){
        return specificationsService.findadd(specifications);
    }
//   删除
@GetMapping("/del")
public  JsonRes del(Integer id){
     return specificationsService.del(id);
}


}
